package com.yueyang.sojourn.server.service.sojourn.merch.inventory;

import com.yueyang.sojourn.server.model.po.SojournMerchInventory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author yemingxing
 * @summary
 * @Copyright (c) 2020, Yueyang Group All Rights Reserved.
 * @since 2020-04-05 16:42
 */
@Mapper
public interface SojournMerchInventoryMapper {
    int insert(SojournMerchInventory record);

    SojournMerchInventory selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SojournMerchInventory record);

    int batchInsert(@Param("list") List<SojournMerchInventory> list);

    List<SojournMerchInventory> selectByMerchIdAndEffectDate(@Param("merchId") long merchId,
                                                             @Param("effectDateStart") Date effectDateStart,
                                                             @Param("effectDateEnd") Date effectDateEnd);

    int takeInventory(@Param("id") long id, @Param("number") int number, @Param("version") int version);

    int addInventory(@Param("id") long id, @Param("number") int number, @Param("version") Integer version);

    List<SojournMerchInventory> selectByMerchId(@Param("merchId") Long merchId);
}